<html>

	<head>
		<title></title>
		<meta charset="UTF-8" />
	</head>

	<body>
		<div id="a1">
			<button onclick="write()"></button>
		</div>
	</body>
	<script type="text/javascript">
		//封装对象
		var person = new Object();
		person.nam = "白金浩";
		person.num = "176307003";
		person.score = 100;
		person.sayName = function() {
			alert(this.nam);
		}
		person.sayName();
		//
		var student = {
			name:'lili',
			num:'123456',
			score:78,
			pscore:function(){
				alert(student.score)
			}
		}
	</script>

</html>